<?php

class webView extends View
{
	
	public function render ( $data, $params, $template = NULL, $layout = NULL )
	{
		
		header ( 'content-type: text/html; charset=UTF-8' ) ;
		
		$output = new Smarty ;
		$output->compile_dir = './cache/Smarty/compiled' ;
		$output->cache_dir = './cache/Smarty/caching' ;
		
		$output->assign ( $data ) ;
		
		if ( $layout != NULL && $template != NULL )
		{
			
			$output->assign ( 'template', 'tpl/' . $template . '.tpl' ) ;
			$output->display ( 'tpl/' . $layout . '.tpl' ) ;
			
		}
		elseif ( $template != NULL )
			$output->display ( 'tpl/' . $template . '.tpl' ) ;
		
	}
	
}

?>